<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$use_sub_dirs</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.variables.html" title="Chapter 13. Smarty Class Variables">
<link rel="prev" href="variable.use.include.path.html" title="$use_include_path">
<link rel="next" href="api.functions.html" title="Chapter 14. Smarty Class Methods">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">$use_sub_dirs</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="variable.use.include.path.html">Prev</a> </td>
<th width="60%" align="center">Chapter 13. Smarty Class Variables</th>
<td width="20%" align="right"> <a accesskey="n" href="api.functions.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="$use_sub_dirs">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="variable.use.sub.dirs"></a>$use_sub_dirs</h2></div></div></div>
<p>
Smarty will create subdirectories under the
<a class="link" href="variable.compile.dir.html" title="$compile_dir">compiled templates</a> and
<a class="link" href="variable.cache.dir.html" title="$cache_dir">cache</a>
directories if <em class="parameter"><code>$use_sub_dirs</code></em> is set to <code class="constant">TRUE</code>,
 default is <code class="constant">FALSE</code>.
In an environment where there are potentially tens of thousands of files created,
this may help the filesystem speed.
On the other hand, some environments do not allow PHP processes to
create directories, so this must be disabled which is the default.
</p>
<p>
Sub directories are more efficient, so use them  if you can.
Theoretically you get much better perfomance on a filesystem with 10
directories each having 100 files, than with 1 directory having 1000
files. This was certainly the case with Solaris 7 (UFS)... with newer
filesystems such as ext3 and especially reiserfs, the difference is almost
nothing.
</p>
<div class="note" title="Technical Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Technical Note</h3>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p><code class="literal">$use_sub_dirs=true</code> doesn't work with
	<a class="ulink" href="http://php.net/features.safe-mode" target="_top">safe_mode=On</a>,
	that's why it's switchable and why it's off by default.
	</p></li>
<li class="listitem"><p><code class="literal">$use_sub_dirs=true</code> on Windows can cause problems.</p></li>
<li class="listitem"><p>Safe_mode is being deprecated in PHP6.</p></li>
</ul></div>
</div>
<p>
  See also
  <a class="link" href="variable.compile.id.html" title="$compile_id"><em class="parameter"><code>$compile_id</code></em></a>,
  <a class="link" href="variable.cache.dir.html" title="$cache_dir"><em class="parameter"><code>$cache_dir</code></em></a>,
   and
   <a class="link" href="variable.compile.dir.html" title="$compile_dir"><em class="parameter"><code>$compile_dir</code></em></a>.
 </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="variable.use.include.path.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.variables.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="api.functions.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">$use_include_path </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Chapter 14. Smarty Class Methods</td>
</tr>
</table>
</div>
</body>
</html>
